const Mock = require('mockjs')
const data = Mock.mock({
    'items|30': [{
        index: '@increment',    //序号
        number: '@integer(100000000000, 999999999999)',    //业主编号
        name: () => {                                           //业主名称
            const randomLength = Mock.Random.integer(2, 3);
            let chineseCharacters = '';
            for (let i = 0; i < randomLength; i++) {
                chineseCharacters += String.fromCharCode(Mock.Random.integer(0x4e00, 0x9fa5));
            }
            return chineseCharacters;
        },
        top_up:'@integer(10, 999)',      //充值金额
        deduction: '@float(-100, 0, 2, 2)',    //扣费金额
        Pay: '@pick(["微信", "支付宝"])',     //缴费方式
        display_time: '@datetime',     //操作时间
    }]
})

module.exports = [
    {
        url: '/vue-admin-template/dataManage/prepayment',
        type: 'get',
        response: config => {
            const items = data.items
            return {
                code: 20000,
                data: {
                    total: items.length,
                    items: items
                }
            }
        }
    }
]
